package com.duolaibei.business.view.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;

import com.duolaibei.business.R;
import com.duolaibei.business.base.BaseDialog;
import com.duolaibei.business.utils.inject.Inject;

/**
 * Created by xlm on 2017/11/8 0008
 */

public class SavePhotoDialog extends BaseDialog {

    @Inject(R.id.save_to_photo)
    private TextView mTextViewSavePhoto;
    @Inject(R.id.save_to_cancle)
    private TextView mTextViewCancle;

    public SavePhotoDialog(Context context) {
        super(context);
    }

    @Override
    protected void onSetContentView() {
        setContentView(R.layout.dialog_save_photo);
    }

    @Override
    protected void initViews() {
        initWindow(1.0f, 0, Gravity.BOTTOM);
        setAnimate(R.style.animatedialog);
    }

    @Override
    protected void onSetListener() {
        mTextViewSavePhoto.setOnClickListener(this);
        mTextViewCancle.setOnClickListener(this);
    }

    @Override
    protected void afterOnCreate(Bundle savedInstanceState) {

    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        if (R.id.save_to_photo == v.getId()) {
            //保存
            listener.onComfirm();
        } else if (R.id.save_to_cancle == v.getId()) {
            //取消
            listener.onCancle();
        }
    }

    private Listener listener;

    public void setListener(Listener listener) {
        this.listener = listener;
    }

    public static class Listener {

        public void onComfirm() {

        }

        public void onCancle() {
        }
    }
}
